//封装
function myAjax(methods, url, data) {
    return new Promise((resolve, reject) => {
        var xml = new XMLHttpRequest();
        xml.open(methods, url, true)   //methods代表请求类型（GET/POST）  url发送请求的接口
        xml.send(data)   //GET data  : null    POST data : {}
        xml.onreadystatechange = function () {
            if (xml.readyState == 4 && xml.status == 200) {
                resolve(xml.response)
            }
        }
    })
}